home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / ps / sun4.md / mach.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-09-24  |  1.3 KB  |  50 lines

  1. /* 
  2.  * mach.c --
  3.  *
  4.  *    This file contains machine-dependent information needed by
  5.  *    the ps program.
  6.  *
  7.  * Copyright 1988 Regents of the University of California
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  */
  16.  
  17. #ifndef lint
  18. static char rcsid[] = "$Header: /sprite/src/cmds/ps/sun4.md/RCS/mach.c,v 1.3 90/09/24 14:39:54 douglis Exp $ SPRITE (Berkeley)";
  19. #endif not lint
  20.  
  21. #include "sys.h"
  22. #include "sprite.h"
  23.  
  24. /*
  25.  *----------------------------------------------------------------------
  26.  *
  27.  * getTicksPerSecond --
  28.  *
  29.  *    Return one second's worth of timer ticks for the current machine.
  30.  *      This is needed by ps to deal with weighted usages.
  31.  *
  32.  * Results:
  33.  *    One second's worth of timer ticks.
  34.  *
  35.  * Side effects:
  36.  *    None.
  37.  *
  38.  *----------------------------------------------------------------------
  39.  */
  40.  
  41. int
  42. getTicksPerSecond()
  43. {
  44.     Sys_MachineInfo machType;
  45.  
  46.     (void) Sys_GetMachineInfo (sizeof (machType), &machType);
  47.  
  48.     return ((machType.type & SYS_SUN_ARCH_MASK) == SYS_SUN_4_C) ? 1000000 : 1000;
  49. }
  50.